<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
	
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/carList.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachesListPageByCarRefuel.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
select{width: 234px;height: 31px}
.gn_name{padding-top: 5px}
.div_zilei{padding-left: 90px;height: 30px}
.tr{height:40px;background:#57a0ff;font-weight:700;}
.tr td{font-size: 14px;color: #ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #cccccc}
.date{border: 0;background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
input[type='checkbox']{width: 15px}
.fseq2{border: none;color: #cccccc;text-align: center;}

.subtn3{
	background: #57a0ff, background;
	border-radius: 50px;
	background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
	background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
	background: linear-gradient(top, #57a0ff, #57a1ff);
	background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
	border: 1px solid #2576A8;
	box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
	color: #fff;
	height: 40px;
	text-shadow: 1px 1px 0.5px #22629B;
	outline: none;
}
.findBtn3 {
	background: #427dff, background;
	border-radius: 50px;
	background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
	background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
	background: linear-gradient(top, #57a0ff, #57a1ff);
	background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
	border: 1px solid #2576A8;
	box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
	color: #fff;
	height: 40px;
	text-shadow: 1px 1px 0.5px #57a0ff;
	outline: none;
	margin-left: 100px
}
 .modal-data3 {
			  visibility: hidden; 
			  z-index: 1001;
			  width: 1000px;
			  min-height: 500px;
			  margin: 100px auto;
			  background-color: #FFFFFF;
			 /* border: 1px solid #C80B14;*/
			 -moz-box-shadow:0 10px 20px #8AC1E2 inset,0 -10px 0 #57a0ff inset;
        	 -webkit-box-shadow:0 10px 20px #8AC1E2 inset,0 -10px 0 #57a0ff inset;
      /*         box-shadow:0 0 10px #cccccc; 
			  box-shadow: #cccccc; */
			  box-shadow: 0 10px 20px #57a1ff inset,0 -10px 0 #57a0ff inset;
			  padding: 5px;
			  text-align: center;
			  position: fixed;
			  left: 22%;
		}
		
		.modal-data3 td{padding-left: 15px;padding-right: 15px}
		.modal-data3 tr:FIRST-CHILD td{padding: 0px 10px;}
		.modal-data3 tr{padding-top: 30px}
		.modal-data3 form table {
			margin: 0px
		}
.modal-data6 ,.modal-data7{
	visibility: hidden;
	z-index: 1001;
	min-height: 500px;
	margin: 100px auto;
	background-color: #FFFFFF;
	-moz-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	-webkit-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	box-shadow: 0 10px 20px #57a1ff inset, 0 -10px 0 #57a0ff inset;
	padding: 5px;
	text-align: center;
	position: fixed;
	left: 22%;
}
.subtn3,.subtn4,.subtn5,.subtn6,.subtn7{
	background: #57a0ff, background;
	border-radius: 50px;
	background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
	background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
	background: linear-gradient(top, #57a0ff, #57a1ff);
	background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
	border: 1px solid #2576A8;
	box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
	color: #fff;
	height: 40px;
	text-shadow: 1px 1px 0.5px #22629B;
	outline: none;
}
.modal-data4 ,.modal-data6,.modal-data7{
	visibility: hidden;
	z-index: 1001;
	min-height: 500px;
	margin: 100px auto;
	background-color: #FFFFFF;
	-moz-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	-webkit-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	box-shadow: 0 10px 20px #57a1ff inset, 0 -10px 0 #57a0ff inset;
	padding: 5px;
	text-align: center;
	position: fixed;
	left: 22%;
}
</style>
<body style="background: #f5f5f5">
<div class="main">
<div id="modal-overlay">
			    
		</div>
		
		<div class="weizhi">
			<c:if test="${refuelCardReg.cfbillstate eq 3 }">
				车辆管理>>加油卡加油登记>>修改
			</c:if>
			<c:if test="${refuelCardReg.cfbillstate eq 4 || refuelCardReg.cfbillstate eq 5 }">
				车辆管理>>加油卡加油登记>>查看
			</c:if>
		</div>
<div class="modal-data3" >
				<div style="height: 60px">
				 <ul>
				  	<li  style="text-align: left;margin-left: 60px;height: 40px;line-height: 40px">
				  		<span>名称：</span>
				  		<span>
				  		 	<input class="name3" type="text" >
				  		</span>
				  		<span>
				  			<button class="findBtn3" >
				  				查询
				  			</button>
				  		</span>
				  	</li>
				 </ul>
				</div>
				<div style="width:1000px; height:350px; overflow:scroll;">
			      <form action="">
			        <table class="head3"  style="width: auto;white-space:nowrap;border-spacing:0px">
			        <tr style="background: #f2f2f2;height: 30px;line-height: 20px;" class="sel">
			        <td style="width: 20px"></td> 
			        <td>
			        	名称
			        </td>
			        <td>
			        	编码
			        </td>
			        <td>
			        	简称
			        </td>
			        <td>
			        	描述
			        </td>			       
			        <td>
			        	创建时间
			        </td>
			        <td>
			        	用户名
			        </td>
			        <td>
			        	别名
			        </td>
			        <td>
			        	最后修改时间
			        </td>
			        <td>
			        	财务组织
			        </td>
			        <td>
			        	余额
			        </td>			      		       			       
			        </tr>
			        <c:forEach items="${fillingCardList }" var="fillingCard">
			        	<tr class="fillingCard">
			        		<td><input style="width: 20px;" type="checkbox" class="check" name="fillingCard" value="${fillingCard.fid }"/></td>
			        		<td>${fillingCard.fnameL2 }</td>
			        		<td>${fillingCard.fnumber }</td>
			        		<td>${fillingCard.fsimplename }</td>
			        		<td>${fillingCard.fdescriptionL2 }</td>
			        		<td>${fillingCard.fcreatetime }</td>
			        		<td>${fillingCard.createName }</td>
			        		<td>${fillingCard.createName }</td>
			        		<td>${fillingCard.flastupdatetime }</td>
			        		<td>${fillingCard.cfficompanyName }</td>
			        		<td>${fillingCard.cfamount }</td>
			        	</tr>
			        </c:forEach> 			        
			        </table>
			      </form>
					<button class="subtn3"
							style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;left: 280px">
			      	确定
			      </button>
					<button class="btn"
							style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;right: 280px">
			      	关闭
			      </button>
			     </div>			    
			</div>

	<div class="modal-data7">
		<div style="height: 60px">
			<ul>
				<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
					<span>名称：</span> <span> <input class="name3" type="text">
					</span> <span>
							<button class="findBtn7">查询</button>
					</span>
				</li>
			</ul>
		</div>
		<div style="width: 1100px; height: 350px; overflow: scroll;">
			<form action="">
				<table class="head3"
					   style="width:auto; white-space: nowrap; border-spacing: 0px">
					<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
						class="sel">
						<td style="width: 20px"></td>
						<td>员工编号</td>
						<td>员工姓名</td>
						<td>部门</td>
						<td>员工类型</td>
						<td>身份证号码</td>
						<td>手机号码</td>
						<td>地址</td>
						<td>出生日期</td>
						<td>入职日期</td>
						<td>转正日期</td>
						<td>离职日期</td>
						<td>合同到期日</td>
						<td>社保编号</td>
						<td>车辆</td>
						<td>性别</td>
						<td>职级职等</td>
						<td>薪酬调整</td>
						<td>岗位异动</td>
						<td>请假记录</td>
						<td>违纪奖励记录</td>
						<td>社会保险记录</td>
						<td>计算招生提成</td>
						<td>计算培训提成</td>
					</tr>
					<c:forEach items="${persons}" var="persons" varStatus="s">
						<tr style="margin-top: 45px" class="jx">
							<td><input type="checkbox" class="check"
									   value="${persons.fid}" name="train" /></td>
							<td>${persons.fnumber}</td>
							<td>${persons.fnameL2}</td>
							<td>${persons.cfpersondepName}</td>
							<c:if test="${empty persons.cfpersontype}">
								<td></td>
							</c:if>
							<c:if test="${persons.cfpersontype == '0'}">
								<td></td>
							</c:if>
							<c:if test="${persons.cfpersontype == '1'}">
								<td>办公室职员</td>
							</c:if>
							<c:if test="${persons.cfpersontype == '2'}">
								<td>教练</td>
							</c:if>
							<c:if test="${persons.cfpersontype == '3'}">
								<td>其他</td>
							</c:if>
							<td>${persons.cfidcardno}</td>
							<td>${persons.cfcell}</td>
							<td>${persons.cfaddress}</td>
							<td>${persons.cfbirthdays}</td>
							<td>${persons.cfbegindate}</td>
							<td>${persons.cfstartdate}</td>
							<td>${persons.cfenddate}</td>
							<td>${persons.cfhtdqsj}</td>
							<td>${persons.cfaccountsno}</td>
							<td>${persons.cfcarName}</td>
							<c:if test="${empty persons.cfsex}">
								<td></td>
							</c:if>
							<c:if test="${persons.cfsex == '1'}">
								<td>男</td>
							</c:if>
							<c:if test="${persons.cfsex == '2'}">
								<td>女</td>
							</c:if>
							<td>${persons.positiongradeName}</td>
							<td>${persons.cfxctz}</td>
							<td>${persons.cfgwyd}</td>
							<td>${persons.cfqjjl}</td>
							<td>${persons.cfwjjljl}</td>
							<td>${persons.cfshjljl}</td>
							<c:if test="${empty persons.cfzstc}">
								<td><input type="checkbox" disabled="disabled"></td>
							</c:if>
							<c:if test="${persons.cfzstc == '0'}">
								<td><input type="checkbox" disabled="disabled"></td>
							</c:if>
							<c:if test="${persons.cfzstc == '1'}">
								<td><input type="checkbox" disabled="disabled"
										   checked="checked"></td>
							</c:if>
							<c:if test="${empty persons.cfpxtc}">
								<td><input type="checkbox" disabled="disabled"></td>
							</c:if>
							<c:if test="${persons.cfpxtc == '0'}">
								<td><input type="checkbox" disabled="disabled"></td>
							</c:if>
							<c:if test="${persons.cfpxtc == '1'}">
								<td><input type="checkbox" disabled="disabled"
										   checked="checked"></td>
							</c:if>
						</tr>
					</c:forEach>
				</table>

				<input type="hidden" class="type">
			</form>
		</div>
		<button class="subtn7"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
			确定</button>
		<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
			关闭</button>
	</div>
	<div class="modal-data4" >
		<div style="height: 60px">
			<ul>
				<li  style="text-align: left;margin-left: 60px;height: 40px;line-height: 40px">
					<span>名称：</span>
					<span>
				  		 	<input class="name4" type="text" >
				  		</span>
					<span>
				  			<button class="findBtn4" >
				  				查询
				  			</button>
				  		</span>
				</li>
			</ul>
		</div>
		<div style="width:1000px; height:350px; overflow:scroll;">
			<form action="">
				<table class="head4"  style="width: auto;white-space:nowrap;border-spacing:0px">
					<tr style="background: #f2f2f2;height: 30px;line-height: 20px;" class="sel">
						<td style="width: 20px"></td>
						<td>
							名称
						</td>
						<td>
							编码
						</td>
						<td>
							简称
						</td>
						<td>
							描述
						</td>
						<td>
							创建时间
						</td>
						<td>
							用户名
						</td>
						<td>
							别名
						</td>
						<td>
							最后修改时间
						</td>
						<td>
							财务组织
						</td>
						<td>科目</td>
						<td>队长</td>
					</tr>
					<c:forEach items="${teams }" var="team">
						<tr class="coachteam">
							<td><input style="width: 20px;" type="checkbox" class="check" name="team" value="${team.fid }"/></td>
							<td class="teamname">${team.fnameL2 }</td>
							<td>${team.fnumber }</td>
							<td>${team.fsimplename }</td>
							<td>${team.fdescriptionL2 }</td>
							<td>${team.fcreatetime }</td>
							<td>${team.createName }</td>
							<td>${team.createName }</td>
							<td>${team.flastupdatetime }</td>
							<td>${team.companyName }</td>
							<c:if test="${team.cfkemu  eq 1}">
								<td>科目一</td>
							</c:if>
							<c:if test="${team.cfkemu  eq 2}">
								<td>科目二</td>
							</c:if>
							<c:if test="${team.cfkemu  eq 3}">
								<td>科目三</td>
							</c:if>
							<c:if test="${team.cfkemu  eq 4}">
								<td>科目四</td>
							</c:if>
							<td>${team.teamName }</td>
						</tr>
					</c:forEach>
				</table>
			</form>
			<button class="subtn4"
					style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;left: 280px">
				确定
			</button>
			<button class="btn"
					style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;right: 280px">
				关闭
			</button>
		</div>
	</div>
	<div class="modal-data6">
		<div style="height: 60px">
			<ul>
				<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
					<span>名称：</span> <span> <input class="name6" type="text">
					</span> <span>
							<button class="findBtn6">查询</button>
					</span>
				</li>
			</ul>
		</div>
		<div style="width: 1100px; height: 350px; overflow: scroll;">
			<form action="">
				<table class="head6"
					   style="width: auto; white-space: nowrap; border-spacing: 0px">
					<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
						class="sel">
						<td style="width: 20px"></td>
						<td width="100px">名称</td>
						<td width="100px">编码</td>
						<td width="100px">简称</td>
						<td width="100px">描述</td>
						<td width="150px">创建时间</td>
						<td width="100px">用户名</td>
						<td width="150px">最后修改时间</td>
						<td width="100px">用户名</td>
					</tr>
					<c:forEach items="${oilspecs}" var="s">
						<tr style="margin-top: 45px" class="oilspec">
							<td><input type="checkbox" class="check" value="${s.fid}" name="oilspec" /></td>
							<td>${s.fnameL2}</td>
							<td>${s.fnumber}</td>
							<td>${s.fsimplename}</td>
							<td>${s.fdescriptionL2}</td>
							<td>${s.fcreatetime}</td>
							<td>${s.createName}</td>
							<td>${s.flastupdatetime}</td>
							<td>${s.updateName}</td>
						</tr>
					</c:forEach>
				</table>
			</form>
		</div>
		<button class="subtn6"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
			确定</button>
		<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
			关闭</button>
	</div>


	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
	<c:if test="${refuelCardReg.cfbillstate eq 3 }">
			<div class="div_form">		
				<form action="<%=path%>/DrivingSys/updateRefuelCardReg" class="form" id="update_refuelCardReg" onsubmit="return subForm()" method="get">
					<input type="hidden" name="fid" value="${refuelCardReg.fid}">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text"  id="fnumber" name="fnumber" value="${refuelCardReg.fnumber}" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${refuelCardReg.fbizdate}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${refuelCardReg.fdescription}"/>								
							</div>							
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" >
									<option id="shenhe" style="color: gray;" value="3">保存</option>
								</select>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油卡&nbsp;:&nbsp;</span>
								<input type="text" class="cfrefuelName is_click_ne" name="" value="${refuelCardReg.cfrefuelName}"/>
								<input type="hidden" name="cfrefuelid" class="cfrefuelid" value="${refuelCardReg.cfrefuelid}">
							</div>
					</div>
					
					<div class="div_zilei">
							<div style="width: 75%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight:700;font-size: 14px;" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 75%;padding-left: 90px;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"><%--<input type="checkbox" name="" class="check">--%></td>
										<td  width="40px">序号</td>
										<td align="center">车牌号码</td>
										<td align="center">数量(加油量L)</td>
										<td align="center">单价</td>
										<td align="center">金额</td>
										<td align="center">车型</td>
										<td align="center">部门</td>
										<td align="center">教练员</td>
										<td align="center">教练队</td>
										<td align="center">教练组</td>
										<td align="center">科目</td>
										<td align="center">油规格</td>
										<td align="center">备注</td>
										<td align="center">车辆加油时间</td>
									</tr>
							<c:forEach items="${refuelCardReg.refuelCardRegEntryList }"  var="refuelCardRegEntry">
								<tr style="margin-top: 45px" class="">
								<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>
    							<td><input type="text" name="fseq" class="fseq" value="${refuelCardRegEntry.fseq }"  readonly unselectable="on" style="width:40px;border:none;color:#cccccc;text-align: center;"></td>
    							<td><input type="text" name="carfnumber" value="${refuelCardRegEntry.cfcarName }"  onblur="selectInfo((this))"><input type="hidden" name="carId" value="${refuelCardRegEntry.cfcarid }"></td>
    							<td><input type="text" name="cfqty" value="${refuelCardRegEntry.cfqty }" class="cfqty" onblur="countCfqty($(this))"><input type="hidden" value=""></td><td><input type="text" name="cfprice" value="${refuelCardRegEntry.cfprice }" class="cfprice" onblur="countCfamount($(this))"><input type="hidden" value=""></td>
    							<td><input type="text" name="cfamount" value="${refuelCardRegEntry.cfamount }" class="cfamount" readonly="readonly"><input type="hidden" value=""></td>
    							<td><input type="text" name="cfcartype" value="${refuelCardRegEntry.cfcartype }" class="cfcartype" readonly="readonly"></td>
    							<td><input type="text" name="cfdepname" value="${refuelCardRegEntry.cfdepname }" class="cfdepname" readonly="readonly"></td>
								<td><input type="text" id="cftrainName" name="cftrainName" class="is_click" onclick="changtrain($(this))" value="${refuelCardRegEntry.cftrainid }"><input type="hidden" id="cftrainid" name="cftrainid" value=""></td>
								<td><input type="text" name="cfteamName"  class="is_click_ne" onclick="changteam($(this))" value="${refuelCardRegEntry.cfteamcoach }"><input type="hidden" name="cfteamid" ></td>
								<td><input type="text" name="cfgroupName"  class="is_click_ne" onclick="changgroup($(this))" value="${refuelCardRegEntry.cfgroupid }"><input type="hidden" name="cfgroupid"></td>
								<td><select name="cfkemu">
									<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="1">科目一</option>
									<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="2">科目二</option>
									<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="3">科目三</option>
									<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="4">备用车</option></select></td>
									<td>
										<input type="text" name="cfoilspecName" class="cfoilspecName is_click" value="${refuelCardRegEntry.cfoilspecid }" onclick="changoilspec2($(this))"><input type="hidden" name="cfoilspecid"<c:if test="${department.fnameL2 == '南昌机动车驾驶员培训中心'}">value="DaMAAAA5cxt6qQrU"</c:if> <c:if test="${department.fnameL2 == \'江西国力机动车驾驶员培训有限公司\'}">value="DaMAAACriON6qQrU"</c:if>>
									</td>
									<td><input type="text" name="cfdesc" value="${refuelCardRegEntry.cfdesc}"></td>
									<td><input type="text" name="cfbizdate" value="${refuelCardRegEntry.cfbizdate}"></td>
								</tr>


							</c:forEach>
							</table>							
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;ma">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<td></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0"  readonly="readonly"  id="cfqty"></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="checkName" value="${refuelCardReg.checkName }" readonly="readonly" style="color: gray;" type="text" />
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="createName" readonly readonly="readonly" value="${refuelCardReg.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" value="${refuelCardReg.fcreatetime}" style="color: gray;" readonly="readonly" type="text"/>
							</div> 
					</div> 
					
					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/sureRefuelCardReg">
							<div>
								<input class="input_submit bc" value="" type="submit">
							</div>
						</shiro:hasPermission>

						<shiro:hasPermission name="/submitRefuelCardReg">
							<div>
								<input type="button" class="input_submit tj" value=""  onclick="audit(4)"/>
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
							<input type="button" class="input_back fh"  value="" onclick="back()"/>
						</div>
					</div>
				</form>							
			</div>
			</c:if>

		<c:if test="${refuelCardReg.cfbillstate eq 4 }">
			<div class="div_form">
				<form action="<%=path%>/DrivingSys/updateRefuelCardReg" class="form" id="update_refuelCardReg">
					<input type="hidden" name="fid" value="${refuelCardReg.fid}">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" id="fnumber" name="fnumber" value="${refuelCardReg.fnumber}" style="color: gray;" readonly="readonly"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${refuelCardReg.fbizdate}"
									onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
							<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
								 src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">备注&nbsp;:&nbsp;</span>
							<input name="fdescription" value="${refuelCardReg.fdescription}" readonly="readonly"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" >
								<option id="shenhe" style="color: gray;" value="4">提交</option>
							</select>
						</div>
						<div class="input_hang">
							<span class="gn_name">加油卡&nbsp;:&nbsp;</span>
							<input type="text"  name="" value="${refuelCardReg.cfrefuelName}"/>
							<input type="hidden" name="cfrefuelid" class="cfrefuelid" value="${refuelCardReg.cfrefuelid}">
						</div>
					</div>

					<div class="div_zilei">
						<div style="width: 75%;text-align: right;">
							<%--<img src="<%=path%>/image/insert2323.jpg" class="addTable">
							<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
							<img src="<%=path%>/image/delete212.png" class="deleteTable">
							<span class="deleteTable" style="color: #a9bbe0;font-size: 14px;" class="deleteTable">删除</span>--%>
						</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 75%;padding-left: 90px;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"><input type="checkbox" name="" class="check"></td>
									<td  width="40px">序号</td>
									<td align="center">车牌号码</td>
									<td align="center">数量(加油量L)</td>
									<td align="center">单价</td>
									<td align="center">金额</td>
									<td align="center">车型</td>
									<td align="center">部门</td>
									<td align="center">教练员</td>
									<td align="center">教练队</td>
									<td align="center">教练组</td>
									<td align="center">科目</td>
									<td align="center">油规格</td>
									<td align="center">备注</td>
									<td align="center">车辆加油时间</td>
								</tr>
								<c:forEach items="${refuelCardReg.refuelCardRegEntryList }"  var="refuelCardRegEntry">
									<tr style="margin-top: 45px" class="">
										<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>
										<td><input type="text" name="fseq" class="fseq" value="${refuelCardRegEntry.fseq }"  readonly unselectable="on" style="width:40px;border:none;color:#cccccc;text-align: center;"></td>
										<td><input type="text" name="carfnumber" value="${refuelCardRegEntry.cfcarName }" onclick="changcar($(this))" readonly="readonly"/><input type="hidden" name="carId" value="${refuelCardRegEntry.cfcarid }" readonly="readonly"/></td>
										<td><input type="text" name="cfqty" value="${refuelCardRegEntry.cfqty }" class="cfqty" onblur="countCfqty($(this))" readonly="readonly"/><input type="hidden" value="" readonly="readonly"/></td><td><input type="text" name="cfprice" value="${refuelCardRegEntry.cfprice }" class="cfprice" onblur="countCfamount($(this))" readonly="readonly"/><input type="hidden" value="" readonly="readonly"/></td>
										<td><input type="text" name="cfamount" value="${refuelCardRegEntry.cfamount }" class="cfamount" readonly="readonly"><input type="hidden" value="" readonly="readonly"/></td>
									<td><input type="text" name="cfcartype" value="${refuelCardRegEntry.cfcartype }" class="cfcartype" readonly="readonly"></td>
									<td><input type="text" name="cfdepname" value="${refuelCardRegEntry.cfdepname }" class="cfdepname" readonly="readonly"></td>
									<td><input type="text" id="cftrainName" name="cftrainName" class="is_click"  value="${refuelCardRegEntry.cftrainid }" readonly="readonly"><input type="hidden" id="cftrainid" name="cftrainid" value=""></td>
									<td><input type="text" name="cfteamName"  class="is_click_ne" value="${refuelCardRegEntry.cfteamcoach }" readonly="readonly"><input type="hidden" name="cfteamid" ></td>
									<td><input type="text" name="cfgroupName"  class="is_click_ne" value="${refuelCardRegEntry.cfgroupid }" readonly="readonly"><input type="hidden" name="cfgroupid"></td>
									<td><select name="cfkemu" readonly="readonly">
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="1">科目一</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="2">科目二</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="3">科目三</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="4">备用车</option></select></td>
									<td>
										<input type="text" name="cfoilspecName" class="cfoilspecName is_click" value="${refuelCardRegEntry.cfoilspecid}" readonly="readonly"><input type="hidden" name="cfoilspecid"<c:if test="${department.fnameL2 == '南昌机动车驾驶员培训中心'}">value="DaMAAAA5cxt6qQrU"</c:if> <c:if test="${department.fnameL2 == \'江西国力机动车驾驶员培训有限公司\'}">value="DaMAAACriON6qQrU"</c:if>>
									</td>
									<td><input type="text" name="cfdesc" value="${refuelCardRegEntry.cfdesc }" readonly="readonly"></td>
									<td><input type="text" name="cfbizdate" value="${refuelCardRegEntry.cfbizdate }" readonly="readonly"></td>


								</c:forEach>
							</table>
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;ma">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<td></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0"  readonly="readonly"  id="cfqty"></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="checkName" value="${refuelCardReg.checkName }" readonly="readonly" style="color: gray;" type="text" />
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="createName" readonly readonly="readonly" value="${refuelCardReg.createName}" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" value="${refuelCardReg.fcreatetime}" style="color: gray;" readonly="readonly" type="text"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/auditRefuelCardReg">
							<div>
								<input type="button" class="input_submit sh" value=""  onclick="audit(5)"/>
							</div>
						</shiro:hasPermission>
						<shiro:hasPermission name="/againstAuditRefuelCardReg">
							<div>
								<input  class="input_submit fsh" value="" type="button" onclick="audit(3)">
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>
			
			<c:if test="${refuelCardReg.cfbillstate eq 5 }">
			<div class="div_form">		
				<form action="<%=path%>/DrivingSys/updateRefuelCardReg" class="form" id="update_refuelCardReg">
					<input type="hidden" name="fid" value="${refuelCardReg.fid}">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" id="fnumber" name="fnumber" value="${refuelCardReg.fnumber}" disabled="disabled" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq"  disabled="disabled" value="${refuelCardReg.fbizdate}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${refuelCardReg.fdescription}"disabled="disabled" />								
							</div>							
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" >
									<option id="shenhe" style="color: gray;" value="5">审核</option>
								</select>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油卡&nbsp;:&nbsp;</span>
								<input type="text"  name="" value="${refuelCardReg.cfrefuelName}" disabled="disabled"/>
								<input type="hidden" name="cfrefuelid" class="cfrefuelid" value="${refuelCardReg.cfrefuelid}" >
							</div>
					</div>
					
					<div class="div_zilei">
							<div style="width: 75%;text-align: right;">
								<%--<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #a9bbe0;font-size: 14px;" class="deleteTable">删除</span>--%>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 75%;padding-left: 90px;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"><input type="checkbox" name="" class="check"></td>
									<td  width="40px">序号</td>
									<td align="center">车牌号码</td>
									<td align="center">数量(加油量L)</td>
									<td align="center">单价</td>
									<td align="center">金额</td>
									<td align="center">车型</td>
									<td align="center">部门</td>
									<td align="center">教练员</td>
									<td align="center">教练队</td>
									<td align="center">教练组</td>
									<td align="center">科目</td>
									<td align="center">油规格</td>
									<td align="center">备注</td>
								</tr>
								<c:forEach items="${refuelCardReg.refuelCardRegEntryList }"  var="refuelCardRegEntry">
								<tr style="margin-top: 45px" class="">
									<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>
									<td><input type="text" name="fseq" class="fseq" value="${refuelCardRegEntry.fseq }"  readonly unselectable="on" style="width:40px;border:none;color:#cccccc;text-align: center;"></td>
									<td><input type="text" name="carfnumber" value="${refuelCardRegEntry.cfcarName }" onclick="changcar($(this))" readonly="readonly"/><input type="hidden" name="carId" value="${refuelCardRegEntry.cfcarid }" readonly="readonly"/></td>
									<td><input type="text" name="cfqty" value="${refuelCardRegEntry.cfqty }" class="cfqty" onblur="countCfqty($(this))" readonly="readonly"/><input type="hidden" value="" readonly="readonly"/></td><td><input type="text" name="cfprice" value="${refuelCardRegEntry.cfprice }" class="cfprice" onblur="countCfamount($(this))" readonly="readonly"/><input type="hidden" value="" readonly="readonly"/></td>
									<td><input type="text" name="cfamount" value="${refuelCardRegEntry.cfamount }" class="cfamount" readonly="readonly"><input type="hidden" value="" readonly="readonly"/></td>
									<td><input type="text" name="cfcartype" value="${refuelCardRegEntry.cfcartype }" class="cfcartype" readonly="readonly"></td>
									<td><input type="text" name="cfdepname" value="${refuelCardRegEntry.cfdepname }" class="cfdepname" readonly="readonly"></td>
									<td><input type="text" id="cftrainName" name="cftrainName" class="is_click"  value="${refuelCardRegEntry.cftrainid }" readonly="readonly"><input type="hidden" id="cftrainid" name="cftrainid" value=""></td>
									<td><input type="text" name="cfteamName"  class="is_click_ne" value="${refuelCardRegEntry.cfteamcoach }" readonly="readonly"><input type="hidden" name="cfteamid" ></td>
									<td><input type="text" name="cfgroupName"  class="is_click_ne" value="${refuelCardRegEntry.cfgroupid }" readonly="readonly"><input type="hidden" name="cfgroupid"></td>
									<td><select name="cfkemu" readonly="readonly">
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="1">科目一</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="2">科目二</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="3">科目三</option>
										<option <c:if test="${refuelCardRegEntry.cfkemu eq 1}">selected=selected</c:if> value="4">备用车</option></select></td>
									<td>
										<input type="text" name="cfoilspecName" class="cfoilspecName is_click" value="${refuelCardRegEntry.cfoilspecid}" readonly="readonly"><input type="hidden" name="cfoilspecid"<c:if test="${department.fnameL2 == '南昌机动车驾驶员培训中心'}">value="DaMAAAA5cxt6qQrU"</c:if> <c:if test="${department.fnameL2 == \'江西国力机动车驾驶员培训有限公司\'}">value="DaMAAACriON6qQrU"</c:if>>
									</td>
									<td><input type="text" name="cfdesc" value="${refuelCardRegEntry.cfdesc }" readonly="readonly"></td>


									</c:forEach>
							</table>							
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;ma">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<td></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0"  readonly="readonly"  id="cfqty"></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfamount"></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="checkName" value="${refuelCardReg.checkName }" disabled="disabled" readonly="readonly" style="color: gray;" type="text" />
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="createName" readonly readonly="readonly" value="${refuelCardReg.createName}" disabled="disabled" style="color: gray;" type="text"/>
							</div> 
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" value="${refuelCardReg.fcreatetime}" style="color: gray;" readonly="readonly" disabled="disabled" type="text"/>
							</div> 
					</div> 
					
					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/againstAuditRefuelCardReg">
							<div>
								<input type="button" class="input_submit fsh" value=""  onclick="audit(3)"/>
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
							<input type="button" class="input_back fh"  value="" onclick="back()"/>
						</div>
					</div>
				</form>							
			</div>
			</c:if>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#table2").show()
	cfqty();//算总数量
	cfamountt();//算总金额
})
//弹出加油卡模式框
$(".cfrefuelName").click(function (){
    $('#modal-overlay').css('visibility', 'visible')
    $('.modal-data3').css('visibility', 'visible')
//    $('.modal-data4').css('visibility', 'visible')
//    $('.modal-data7').css('visibility', 'visible')
    $('input:checkbox[name=fillingCard]').removeAttr('checked');
})
//关闭加油卡模式框
$(".btn").click(function (){
    $('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data3').css('visibility', 'hidden')
    $('.modal-data4').css('visibility', 'hidden')
    $('.modal-data5').css('visibility', 'hidden')
    $('.modal-data7').css('visibility', 'hidden')
    $('input:checkbox[name=fillingCard]').removeAttr('checked');
    $('.modal-data6').css('visibility','hidden');
})
//设置只能单选
$(".fillingCard td").live('click',function(){
    $('input:checkbox[name=fillingCard]:checked').each(function(i) {
    	$(this).removeAttr("checked");
     });
     $(this).parent().find("input:checkbox[name=fillingCard]").attr('checked','checked');
}) 
//双击确认
$(document).on('dblclick','.fillingCard td',function(){	
	var fid = '';//加油卡id
	var cardName='';//加油卡名称
	fid = $(this).parent().find("td").eq("0").find("input:checkbox[name=fillingCard]:checked").val()
	cardName = $(this).parent().find("td").eq("1").html()
	$(".cfrefuelName").val(cardName);
	$(".cfrefuelid").val(fid);
	$('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data3').css('visibility', 'hidden')
   	$('input:checkbox[name=fillingCard]').removeAttr('checked');
})
//查询
$(".findBtn3").click(function (){
	var name = $(".name3").val()
	$.ajax({
        url: '<%=path%>/DrivingSys/selFilingCardByName',
        type: "post",
        data: {'fnameL2': name},
        dataType: "json",
        success: function (json) {  
        	if(json == null){           		
        		var nostr='<tr><td style="width: 30px;"></td><td colspan="5">抱歉，没有相关数据,请重新输入需要查找的名称！</td></tr>'
        			$(".head3").append(nostr)
        	}else{  
        		var str='';
        		for (var i = 0; i < json.length; i++) {
                    if(json[i].fsimplename == null ){
                        json[i].fsimplename = "";
                    }
                    if(json[i].fdescriptionL2 == null){
                        json[i].fdescriptionL2 = "";
                    }
        			str+='<tr class="fillingCard"><td style="width: 20px;" class="td"><input style="width: 20px;" type="checkbox" name="fillingCard" value="'+json[i].fid+'" ></td>';
        			str+='<td>'+json[i].fnameL2+'</td><td>'+json[i].fnumber+'</td><td>'+json[i].fsimplename+'</td><td>'+json[i].fdescriptionL2+'</td>'
        			str+='<td>'+json[i].fcreatetime+'</td><td>'+json[i].createName+'</td>'
        			str+='<td>'+json[i].createName+'</td><td>'+json[i].flastupdatetime+'</td><td>'+json[i].cfficompanyName+'</td>'
        			str+='<td>'+json[i].cfamount+'</td></tr>';            			
        			
				}   	    
        		$(".head3 tr").not(':eq(0)').remove() 
        		$(".head3").append(str)	            		
        	}
        },
        error: function () {
            alert('Error');
        }
    });  
})
//确认把加油卡信息填入
$(".subtn3").click(function (){
	var fid = '';//加油卡id
	var cardName='';//加油卡名称
	$("input:checkbox[name=fillingCard]:checked").each(function (i){
		fid = $(this).val();
		cardName =$(this).parent().parent().find("td").eq("1").html();
	})	
	if( fid == '' || cardName == ''){
		alert("请勾选加油卡！")
		return false;
	}
	$(".cfrefuelName").val(cardName);
	$(".cfrefuelid").val(fid);
	$('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data3').css('visibility', 'hidden')
   	$('input:checkbox[name=fillingCard]').removeAttr('checked');
})


_this = null;//缓存改变车辆对象
//弹出车辆模式框
$(".addTable").click(function(){
	_this = null;//清空缓存
	$('#modal-overlay').css('visibility', 'visible')
    $('.modal-data1').css('visibility', 'visible')
   	$('input:checkbox[name=train]').removeAttr('checked');
})
//设置全选功选 
$('.check').click(function(){
	if($(this).attr("checked")){
		 $(":checkbox").prop("checked",true) 
	}else{
		$('input:checkbox').removeAttr('checked')
	}
})
//单击选中车辆信息
$(".head1 tr td").live('click',function(){
	if($(this).parent().find("input:checkbox").is(':checked')){
		$(this).parent().find("input:checkbox").removeAttr("checked");
	}else{
		$(this).parent().find("input:checkbox").attr("checked",":checked")
	}
})
//关闭车辆模式框
$(".btn").click(function(){
	_this = null;//清空缓存
	$('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data1').css('visibility', 'hidden')
   	$('input:checkbox[name=train]').removeAttr('checked');
})

//确认按钮把信息填入
$(".subtn1").click(function(){
	var carFnumber = new Array()//车辆编号
	var carId = new Array()//车辆id
	$('input:checkbox[name=train]:checked').each(function(i) {
    	carFnumber[i] = $(this).parent().parent().find("td").eq("2").html() 
    	carId[i] = $(this).parent().parent().find("td").eq("0").children("input:checkbox[name=train]").val()
     });
	if(_this != null){		
		_this.val(carFnumber[0],carId[0]);
		_this.parent().next().children("input").val('')//把之前填入的值清空
		_this.parent().next().next().children("input").val('')//把之前填入的值清空
		_this.parent().next().next().next().children("input").val('')//把之前填入的值清空
        cfqty();//算总数量
        cfamountt();//算总金额
	}else{	
		$('input:checkbox[name=train]:checked').each(function(i) {
	    	carFnumber[i] = $(this).parent().parent().find("td").eq("2").html()   	
	    	addTableTr(carFnumber[i],carId[i])
	     });
		$("#table2").show()//合计显示出来
		//处理序号
		$('input:text[name=fseq]').each(function(j){
			j+=1
			$(this).val(j)
		})
	}	
	$('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data1').css('visibility', 'hidden')
   	$('input:checkbox[name=train]').removeAttr('checked');
})

//双击确认
$(document).on('dblclick','.xysj td',function(){	
	var carFnumber = $(this).parent().find("td").eq("2").html()
	var carId = $(this).parent().find("td").eq("0").children("input:checkbox[name=train]").val()
	if(_this !=null){
		_this.val(carFnumber);
		_this.parent().next().children("input").val('')//把之前填入的值清空
		_this.parent().next().next().children("input").val('')//把之前填入的值清空
		_this.parent().next().next().next().children("input").val('')//把之前填入的值清空
        cfqty();//算总数量
        cfamountt();//算总金额
	}else{
		addTableTr(carFnumber,carId)
		//处理序号
		$('input:text[name=fseq]').each(function(j){
			j+=1
			$(this).val(j)
		})
	}	
	$("#table2").show()//合计显示出来
	$('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data1').css('visibility', 'hidden')
   	$('input:checkbox[name=train]').removeAttr('checked');
})

//删除选中的行
$(".deleteTable").click(function (){
	var k=0;//记录被选中复选框的个数
	$("input:checked[name=check2]").each(function (i){
		k++;	
	})
	if(k == 0){
    	alert("请勾选中需要删除的行！")
    	return false;
	}else{
		$("input:checked[name=check2]").each(function (i){			
			$(this).parent().parent().remove();
			//删除后把总的数量和总金额重新计算一遍
			cfqty();//算总数量
			cfamountt();//算总金额
			//处理序号
			$('input:text[name=fseq]').each(function(j){
				j+=1
				$(this).val(j)
			})
		})
	}
})

//改变车辆
function changcar(obj){
	_this = obj
	$('#modal-overlay').css('visibility', 'visible')
    $('.modal-data1').css('visibility', 'visible')
   	$('input:checkbox[name=train]').removeAttr('checked');
}

function addTableTr(carFnumber,carId){
    var str = '';
    str+='<tr style="margin-top: 45px" class="">'
    str+='<td  width="40px"><input type="checkbox" name="check2" style="width:15px"></td>'
    str+='<td><input type="text" name="fseq" class="fseq" value=""  readonly unselectable="on" style="width:40px;border:none;color:#cccccc;text-align: center;"></td>'
    str+='<td><input type="text" name="carfnumber" value=""  onblur="selectInfo(this)" ><input type="hidden" name="carId"></td>'
    str+='<td><input type="text" name="cfqty" value="" class="cfqty" onblur="countCfqty($(this))"><input type="hidden" value=""></td><td><input type="text" name="cfprice" value="" class="cfprice" onblur="countCfamount($(this))"><input type="hidden" value=""></td>'
    str+='<td><input type="text" name="cfamount" value="0" class="cfamount" readonly="readonly"><input type="hidden" value=""></td>'
    str+='<td><input type="text" name="cfcartype"  readonly="readonly" ></td>'
    str+='<td><input type="text" name="cfdepname"  readonly="readonly" ></td>'

    str+='<td><input type="text" id="cftrainName" name="cftrainName" class="is_click" onclick="changtrain($(this))"><input type="hidden" id="cftrainid" name="cftrainid" value=""></td>'
    str+='<td><input type="text" name="cfteamName"  class="is_click_ne" onclick="changteam($(this))"><input type="hidden" name="cfteamid" ></td>'
    str+='<td><input type="text" name="cfgroupName"  class="is_click_ne" onclick="changgroup($(this))"><input type="hidden" name="cfgroupid"></td>'
    str+='<td><select name="cfkemu"><option value=""></option><option value="1">科目一</option><option selected=selected value="2">科目二</option><option value="3">科目三</option><option value="4">备用车</option></select></td>'
    str+='<td><input type="text" name="cfoilspecName" class="cfoilspecName is_click" value="93#" onclick="changoilspec2($(this))"><input type="hidden" name="cfoilspecid"'+
        '<c:if test="${department.fnameL2 == '南昌机动车驾驶员培训中心'}">value="DaMAAAA5cxt6qQrU"</c:if> <c:if test="${department.fnameL2 == \'江西国力机动车驾驶员培训有限公司\'}">value="DaMAAACriON6qQrU"</c:if>></td>'
    str+='<td><input type="text" name="cfdesc" value=""></td></tr>'
	$("#table1").append(str);
}

//由于和input:checkbox冲突，在选择一次
$("#table1 tr td input:checkbox").live('click',function(){
 if($(this).is(':checked')){
    	$(this).removeAttr("checked");
    }else{
    	$(this).attr("checked",":checked")
    }
})
//单击选中
$("#table1 tr td").live('click',function(){
	if($(this).parent().find("input:checkbox").is(':checked')){
		$(this).parent().find("input:checkbox").removeAttr("checked");
	}else{
		$(this).parent().find("input:checkbox").attr("checked",":checked")
	}
})

function cfqty(){
 var cfqty = 0;
	$(".cfqty").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cfqty = (cfqty*1) + (s*1);
		cfqty = decimal(cfqty,2);
	})
	$("#cfqty").val(cfqty)
}
//计算数量
function countCfqty(obj){
	//避免最后一个字符串是.
 	obj.val((obj.val().replace(/\.$/g, "")));
    if(isNaN(Number(obj.val()))){
        obj.val("");
    }
	var count = obj.val();//输入的数量
	if(count == null || count == ''){
		count = 0;
	}
	 //存放之前的值
	var zq =  obj.next().val();
	obj.next().val(count);
    //计算金额
    var price = obj.parent().parent().find("td").eq("4").children("input:text[name=cfprice]").val();
    if(price == null){
        price = 0;
    }
    count = count*1;//去除类是于 023 数据
    price = decimal(price,2);
    var cfamount = price*count
    cfamount = decimal(cfamount,2)
    //alert("数量:"+count+"单价:"+price+",每辆车的总价:" +cfamount)
    obj.parent().parent().find("td").eq("5").children("input:text[name=cfamount]").val(cfamount)
	//计算总数量
	cfqty();
	 //计算总金额
	cfamountt()
}
function cfamountt(){
	var cfamount = 0;
	$(".cfamount").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cfamount = (cfamount*1) + (s*1);
		cfamount = decimal(cfamount,2);
	})
	$("#cfamount").val(cfamount)	
}

//计算金额
function countCfamount(obj){
	//避免最后一个字符串是.
 	obj.val((obj.val().replace(/\.$/g, "")));
    if(isNaN(Number(obj.val()))){
        obj.val("");
    }
 	var price = obj.val();//输入的单价
 	if(price == ''){
 		price = 0; 		
 	}
	//获取单价对应的数量
	var count = obj.parent().parent().find("td").eq("3").children("input:text[name=cfqty]").val();
	if( count == ''){
		count = 0;		
	}
	count = count*1;//去除类是于 023 数据
	price = decimal(price,2);
	var cfamount = price*count		
	//alert("数量:"+count+"单价:"+price+",每辆车的总价:" +cfamount)
	cfamount = decimal(cfamount,2)
	obj.parent().parent().find("td").eq("5").children("input:text[name=cfamount]").val(cfamount)			
	//计算总金额
	cfamountt();	
}
//num是要处理的数字  v为要保留的小数位数
function decimal(num,v){
	var vv = Math.pow(10,v);
return Math.round(num*vv)/vv;
}

//键盘事件
$(".cfqty,.cfprice").live('keyup', function(event) {
		//最后一位是小数点的话，移除
		var $amountInput = $(this);
		//响应鼠标事件，允许左右方向键移动 
		event = window.event || event;
		if(event.keyCode == 37 | event.keyCode == 39) {
			return;
		}
		//先把非数字的都替换掉，除了数字和. 
		$amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
		//只允许一个小数点              
		replace(/^\./g, "").replace(/\.{2,}/g, ".").
		//只能输入小数点后两位
		replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
});
//返回
function back(){
    parent.closeSelectCard()

//    location = '<%=path%>/DrivingSys/queryRefuelCardReg/look.action';
} 
//改变审核状态
function audit(num) {
    var fid = $("input:hidden[name=fid]").val();
    var fnumber =$("input:text[name=fnumber]").val();
    if(num == 3){//反审核
        $('#modal-overlay').css('visibility', 'visible');
        $('.modal-data10').css('visibility', 'visible');
        $("#againstAuditsubmit").click(function(){
            var againstAuditcomment = $("#againstAuditcomment").val();
            if (againstAuditcomment == null || againstAuditcomment == '') {
                againstAuditcomment = "不同意";
            }
            $.ajax({
                url:'<%=path%>/DrivingSys/againstCheckRefuelCardRegActiviti',
                type:'post',
                data:{'fid':fid,'fnumber':fnumber,'againstAuditcomment':againstAuditcomment},
                dataType:'json',
                success:function(result){
                    if(result["result"] == 'success'){
                        showAlert("反审核成功!","queryRefuelCardReg/look.action")
                       /* alert("反审核成功!")
                        setTimeout(function () {
                            location="<%=path%>/DrivingSys/queryRefuelCardReg/look.action";
                        }, 1000);*/
                    }else{
                        alert("反审核失败!")
                    }
                },
                error:function () {alert('Error')}
            })
        })
    }
    if(num == 4){//提交
        $.messager.confirm('提示', '是否提交?', function (r) {
            if(r){
                $.ajax({
                    url:'<%=path%>/DrivingSys/submitRefuelCardRegActiviti',
                    type:'post',
                    data:{'fid':fid,'fnumber':fnumber},
                    dataType:'json',
                    success:function(result){
                        if(result["result"] == 'success'){
                            showAlert("提交成功!","queryRefuelCardReg/look.action")
                            /*alert("提交成功!")
                            setTimeout(function () {
                                location="<%=path%>/DrivingSys/queryRefuelCardReg/look.action";
                            }, 1000);*/
                        }else{
                            alert("提交失败!")
                        }
                    },
                    error:function () {alert('Error')}
                })
			}
		})
    }
    if(num == 5){//审核
        $('#modal-overlay').css('visibility', 'visible');
        $('.modal-data9').css('visibility', 'visible');
        $("#auditsubmit").click(function() {
            var agree = $("input:radio[name=check]:checked").val();//同意不同意
            var auditcomment = $("#auditcomment").val();
            if (agree == null) {
                alert("你选择你的意见");
                return false;
            }
            if (auditcomment == null || auditcomment == '') {
                if(agree == "1"){
                    auditcomment = "同意";
                }else{
                    auditcomment = "不同意";
                }
            }
            $.ajax({
                url:'<%=path%>/DrivingSys/checkRefuelCardRegActiviti',
                type:'post',
                data:{'fid':fid,'fnumber':fnumber,'agree':agree,'auditcomment':auditcomment},
                dataType:'json',
                // async: true,
                success:function(result){
                    if(result["result"] == 'success'){
                        showAlert("审核成功!","queryRefuelCardReg/look.action")
                        /*alert("审核成功!")
                        setTimeout(function () {
                            location="<%=path%>/DrivingSys/queryRefuelCardReg/look.action";
                        }, 1000);*/
                    }else{
                        alert("审核失败!")
                    }
                },
                error:function () {alert('Error')}
            })
        })
    }
}


//验证没有子数据不能保存
function subForm() {
    var count =0;
    $("input:checkbox[name=check2]").each(function (i) {
        count++;
    })
    var cfrefuelName = $(".cfrefuelName").val();
    if(cfrefuelName == null || cfrefuelName ==''){
        alert("加油卡不能为空!")
        return false;
    }
    if(count==0){
        alert("至少添加一条数据!")
        return false;
    }
    $("input[type='submit']").attr("disabled", "disabled");
}
/**
 * 回填
 * @param _this
 */
function selectInfo(_this) {
    var $this = $(_this)
    var carName = $this.val()
    $.ajax({
        url:'<%=path%>/DrivingSys/selCarRefuelByName',
        type: "post",
        data:{'carName':carName},
        dataType:"json",
        success:function(json){
            $this.val(json.carFnumber)
			$this.parent().find('input[name="carId"]').val("")
			$this.parent().find('input[name="carId"]').val(json.cfcarnoid)

            $this.parent().next().next().next().next().find('input[name="cfcartype"]').val(json.cfcartype)
            $this.parent().next().next().next().next().next().find('input[name="cfdepname"]').val(json.cfdepname)
            $this.parent().next().next().next().next().next().next().find('input[name="cftrainName"]').val(json.cftrainName)
            $this.parent().next().next().next().next().next().next().find('input[name="cftrainid"]').val(json.cftrainid)

        },
        error: function(){alert('错误！！！');}
    })
}
//弹出教练框
var trainName;//教练对象
function changtrain(obj){
    trainName = obj //给教练对象赋值
    $('#modal-overlay').css('visibility','visible')
    $('.modal-data7').css('visibility','visible')
    $('input:checkbox').removeAttr('checked');
}
//弹出教练队摸态框
var team;//教练队对象
function changteam(obj){
    team = obj;//把选中需要修改的教练队对象保存下来
    $('#modal-overlay').css('visibility','visible')
    $('.modal-data4').css('visibility','visible')
    $('input:checkbox').removeAttr('checked');
}

//单击教练队
$(".coachteam td").live('click',function(){
    $('input:checkbox[name=team]:checked').each(function(i) {
        $(this).removeAttr("checked");
    });
    $(this).parent().find("input:checkbox").attr('checked','checked');
})
//双击确定车辆
$(document).on('dblclick','.coachteam td',function(){
    var teamId;//教练队id
    var teamName;//教练队名
    $('input:checkbox[name=team]:checked').each(function(i) {
        teamId = $(this).val();
        teamName = $(this).parent().next().text();
    });
//            alert(teamId+" "+teamName)
    team.val(teamName)
    team.next().val(teamId)
    //清空教练队对象
    team = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data4').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
$(".subtn4").click(function(){
    var teamId;//教练队id
    var teamName;//教练队名
    $('input:checkbox[name=team]:checked').each(function(i) {
        teamId = $(this).val();
        teamName = $(this).parent().next().text();
        //alert(teamId+" "+teamName)
    });
    if(teamId == null){
        alert("请勾选需要选中的行！")
        return false;
    }
    team.val(teamName)
    team.next().val(teamId)
    //清空教练队对象
    team = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data4').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
//根据名称查找教练队
$(".findBtn4").click(function(){
    var name = $(".name4").val();
    $.ajax({
        url:'<%=path%>/DrivingSys/queryTeamByName2',
        type: "post",
        data:{'name':name},
        dataType:"json",
        success:function(json){
            var str = '';
            for (var i = 0; i < json.length; i++) {
                str='<tr class="coachteam">'
                str+='<td><input style="width: 20px;" type="checkbox" class="check" name="team" value="'+json[i].fid+'"/></td>'
                str+='<td>'+json[i].fnameL2+'</td><td>'+json[i].fnumber+'</td><td>'+json[i].fsimplename+'</td><td>'+json[i].fdescriptionL2+'</td>'
                str+='<td>'+json[i].fcreatetime+'</td><td>'+json[i].createName+'</td><td>'+json[i].createName+'</td>'
                str+='<td>'+json[i].flastupdatetime+'</td><td>'+json[i].companyName+'</td>'
                if(json[i].cfkemu == 1){
                    str+='<td>科目一</td>'
                }else if(json[i].cfkemu == 2){
                    str+='<td>科目二</td>'
                }else if(json[i].cfkemu == 3){
                    str+='<td>科目三</td>'
                }else{
                    str+='<td>科目四</td>'
                }
                str+='<td>'+json[i].teamName+'</td></tr>'
            }
            $(".head4 tr:not(':first')").remove()
            $('.head4').append(str)
        },
        error: function(){
            /* alert(XMLHttpRequest.readyState +" "+ XMLHttpRequest.status +" "+ XMLHttpRequest.responseText);  */
            alert('错误！！！');}
    })
})
//弹出教练组框
var group;//教练组对象
function changgroup(obj){
    group = obj;//把需要添加的对象赋值给教练组对象
    $('#modal-overlay').css('visibility','visible')
    $('.modal-data5').css('visibility','visible')
    $('.page').show()
    $('input:checkbox').removeAttr('checked');
}

//单据选中教练组
$(".coacegroup td").live('click',function(){
    $('input:checkbox[name=group]:checked').each(function(i) {
        $(this).removeAttr("checked");
    });
    $(this).parent().find("input:checkbox").attr('checked','checked');
})
//双击确定教练组
$(document).on('dblclick','.coacegroup td',function(){
    var groupId;//教练组id
    var groupName;//教练组名
    $('input:checkbox[name=group]:checked').each(function(i) {
        groupId = $(this).val();
        groupName = $(this).parent().next().text();
        //alert(groupId+" "+groupName)
    });
    group.val(groupName)
    group.next().val(groupId)
    //清空教练队对象
    group = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data5').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
//确定按钮教练组
$(".subtn5").click(function (){
    var groupId;//教练组id
    var groupName;//教练组名
    $('input:checkbox[name=group]:checked').each(function(i) {
        groupId = $(this).val();
        groupName = $(this).parent().next().text();
        //alert(groupId+" "+groupName)
    });
    group.val(groupName)
    group.next().val(groupId)
    //清空教练队对象
    group = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data5').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
//单击职员
$(".jx td").live('click',function(){
    $('input:checkbox[name=person]:checked').each(function(i) {
        $(this).removeAttr("checked");
    });
    $(this).parent().find("input:checkbox").attr('checked','checked');
})
//双击确定职员数据
$(document).on('dblclick','.jx td',function(){
    var fid;//fid
    var name;//名称
    $('input:checkbox[name=train]:checked').each(function (i) {
        if (0 == i) {
            fid = $(this).val();
            name = $(this).parent().next().next().text();
        }
    });
    if(trainName != null ){
        trainName.val(name)
        trainName.next().val(fid);
        trainName = null;//清空教练对象
        $('#modal-overlay').css('visibility','hidden')
        $('.modal-data7').css('visibility','hidden')
    }else{
        personData(fid,name);
    }
})
//确定按钮把数据填入
$(".subtn3").click(function(){
    var fid;//fid
    var name;//名称
    $('input:checkbox[name=train]:checked').each(function (i) {
        if (0 == i) {
            fid = $(this).val();
            name = $(this).parent().next().next().text();
        }
    });
    if(fid == null ){
        alert("请勾选需要选中的行！")
        return false;
    }
    if(trainName != null ){
        trainName.val(name)
        trainName.next().val(fid);
        trainName = null;//清空教练对象
        $('#modal-overlay').css('visibility','hidden')
        $('.modal-data7').css('visibility','hidden')
    }else{
        personData(fid,name);
    }

})
//放入职员数据
function personData(fid,name){
    $(".cfjypersonName").val(name);
    $(".cfjypersonName").next().val(fid);
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data7').css('visibility','hidden')
}
//根据姓名查询加油人员
$(".findBtn7").click(function(){
    var name = $(".name3").val();
    $.ajax({
        url:'<%=path%>/DrivingSys/quePersonByName',
        type: "post",
        data:{'name':name},
        dataType:"json",
        success:function(json){
            var str = '';
            for (var i = 0; i < json.length; i++) {
                str += '<tr style="margin-top: 45px;height: 30px;" class="jx"><td><input style="width: 15px;height: 15px" '
                str+='type="checkbox" name="train"  value="'+json[i].fid+'"></td>'
                if (json[i].fnumber == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].fnumber + '</td>'
                }
                if (json[i].fnameL2 == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].fnameL2 + '</td>'
                }
                if (json[i].cfpersondepName == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfpersondepName + '</td>'
                }
                if (json[i].cfpersontype == '1') {
                    str += '<td>办公室职员</td>'
                } else if (json[i].cfpersontype == '2') {
                    str += '<td>教练</td>'
                } else if (json[i].cfpersontype == '3') {
                    str += '<td>其他</td>'
                } else {
                    str += '<td></td>'
                }
                if (json[i].cfidcardno == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfidcardno + '</td>'
                }
                if (json[i].cfcell == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfcell + '</td>'
                }
                if (json[i].cfaddress == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfaddress + '</td>'
                }
                if (json[i].cfbirthdays == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfbirthdays + '</td>'
                }
                if (json[i].cfbegindate == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfbegindate + '</td>'
                }
                if (json[i].cfstartdate == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfstartdate + '</td>'
                }
                if (json[i].cfenddate == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfenddate + '</td>'
                }
                if (json[i].cfhtdqsj == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfhtdqsj + '</td>'
                }
                if (json[i].cfhtdqsj == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfaccountsno + '</td>'
                }
                if (json[i].cfcarName == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfcarName + '</td>'
                }
                if (json[i].cfsex == '1') {
                    str += '<td>男</td>'
                } else if (json[i].cfsex == '2') {
                    str += '<td>女</td>'
                } else {
                    str += '<td></td>'
                }
                if (json[i].positiongradeName == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].positiongradeName + '</td>'
                }
                if (json[i].cfxctz == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfxctz + '</td>'
                }
                if (json[i].cfgwyd == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfgwyd + '</td>'
                }
                if (json[i].cfqjjl == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfqjjl + '</td>'
                }
                if (json[i].cfwjjljl == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfwjjljl + '</td>'
                }
                if (json[i].cfshjljl == null) {
                    str += '<td></td>'
                } else {
                    str += '<td>' + json[i].cfshjljl + '</td>'
                }
                if (json[i].cfzstc == '0') {
                    str += '<td><input type="checkbox" disabled="disabled"></td>'
                } else if (json[i].cfzstc == '1') {
                    str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
                } else {
                    str += '<td><input type="checkbox" disabled="disabled"></td>'
                }
                if (json[i].cfpxtc == '1') {
                    str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
                } else {
                    str += '<td><input type="checkbox" disabled="disabled"></td>'
                }
                str += '</tr>';
            }
            $(".head3 tr:not(':first')").remove()
            $('.head3').append(str)
        },
        error: function(){alert('错误！！！');}
    })
})
//加油填入

//弹油规格摸态框
var oilspec;//油规格对象
function changoilspec2(obj){
    oilspec = obj;//把需添加的油规格对象赋值
    $('#modal-overlay').css('visibility','visible')
    $('.modal-data6').css('visibility','visible')
    $('input:checkbox').removeAttr('checked');
}
//单击选中 油规格的信息
$(".head6 tr td").live('click',function(){
    $('input:checkbox[name=oilspec]:checked').each(function(i) {
        $(this).removeAttr("checked");
    });
    $(this).parent().find("input:checkbox").attr('checked','checked');
})
//双击确定 油规格信息
$(document).on('dblclick','.oilspec td',function(){
    var oilspecId;//教练组id
    var oilspecName;//教练组名
    $('input:checkbox[name=oilspec]:checked').each(function(i) {
        oilspecId = $(this).val();
        oilspecName = $(this).parent().next().text();
        //alert(oilspecId+" "+oilspecName)
    });
    oilspec.val(oilspecName)
    oilspec.next().val(oilspecId)
    //清空教练队对象
    oilspec = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data6').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
//确定把油规格信息填入
$(".subtn6").click(function (){
    var oilspecId;//教练组id
    var oilspecName;//教练组名
    $('input:checkbox[name=oilspec]:checked').each(function(i) {
        oilspecId = $(this).val();
        oilspecName = $(this).parent().next().text();
        alert(oilspecId+" "+oilspecName)
    });
    oilspec.val(oilspecName)
    oilspec.next().val(oilspecId)
    //清空教练队对象
    oilspec = null;
    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data6').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');
})
</script>
</html>